package DecoratorPattern.example;

public class Main {
    public static void work(Component c){
        c.work();
    }
    public static void main(String[] args) {
        Component amd_cpu = new CPU("Amd i7");
        work(amd_cpu);
        System.out.println("==========正在装饰风扇，重新调用work==========");
        Component amd_intel_fan = new Fan(amd_cpu, "Intel Zero");
        work(amd_intel_fan);
    }
}
